﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Presentation.Models.PortfolioViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Overview
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Programs</h2>

    <p>
     <% if (Helpers.IsAdmin(this)){%>
        <%: Html.ActionLink("Create new program", "Create", "Program") %>
     <% } %>
    </p>

    <table>
        <tr>
            <th></th>
            <th>
                Name
            </th>
            <th>
                Description
            </th>
        </tr>

    <% foreach (var program in Model.Programs) { %>
    
        <tr>

            <td>
                <% if (Helpers.IsAdmin(this)){%>
                    <%: Html.ActionLink("Edit", "Edit", "Program", new { id = program.Id }, null) %> |
                    <%: Html.ActionLink("Delete", "Delete", "Program", new { id = program.Id }, null) %>
                <% } %>
                <%: Html.ActionLink("View", "View", "Program", new { id = program.Id }, null) %> |
            </td>
            
            <td>
                <%: program.Name %>
            </td>
            
            <td>
                <%: program.Description %>
            </td>

        </tr>
    
    <% } %>

    </table>

    <br />

    <h2>Standalone Projects</h2>

    <p>
        <% if (Helpers.IsAdmin(this)){%>
            <%: Html.ActionLink("Create new standalone project", "Create", "Project", new { programId = 0 }, null )%>
        <% } %>
    </p>

    <% Html.RenderPartial("ProjectList", Model.Projects); %>

</asp:Content>

